<#include "copyright.ftl"/>
package ${basePackage}.${moduleName}.service${submoduleName!?replace("\\", ".")}.impl;

import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.shfft.common.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import ${basePackage}.${moduleName}.mapper${submoduleName!?replace("\\", ".")}.${table.tableAlias}Mapper;
import ${basePackage}.${moduleName}.domain${submoduleName!?replace("\\", ".")}.${table.tableAlias};
import ${basePackage}.${moduleName}.service${submoduleName!?replace("\\", ".")}.${table.tableAlias}Service;
<#if (table.hasDateColumn)>
import java.util.Date;
</#if>
<#if (table.hasBigDecimalColumn)>
import java.math.BigDecimal;
</#if>

/**
 * <p>${table.tableAlias} service实现 </p>
 *
 * @since ${.now}
 */
@Component
@Transactional(readOnly = true) 
public class ${table.tableAlias}ServiceImpl implements ${table.tableAlias}Service {
	private Logger logger = LoggerFactory.getLogger(this.getClass());
	
	@Autowired
	private ${table.tableAlias}Mapper ${table.tableAlias?uncap_first}Mapper;
	
	public void insert(${table.tableAlias} bean) {
		${table.tableAlias?uncap_first}Mapper.insert(bean ) ;
	}
	
	public void update(${table.tableAlias} bean) {
		${table.tableAlias?uncap_first}Mapper.update(bean ) ;
	}
	
	public void delete(<#list table.primaryKeys as key> ${key.javaType} ${key.javaProperty} </#list>){
		${table.tableAlias?uncap_first}Mapper.delete(<#list table.primaryKeys as key> ${key.javaProperty} </#list> ) ;
	}
	
	public ${table.tableAlias} findByPk(<#list table.primaryKeys as key> ${key.javaType} ${key.javaProperty} </#list>){
		return ${table.tableAlias?uncap_first}Mapper.findByPk(<#list table.primaryKeys as key> ${key.javaProperty} </#list> ) ;
	}

	public List<${table.tableAlias} > getList(${table.tableAlias} bean ){
		return ${table.tableAlias?uncap_first}Mapper.getList(bean ) ;
	}
	
	public Page<${table.tableAlias} > getPage(Page<${table.tableAlias}> page, ${table.tableAlias} bean ){
		bean = (bean == null) ? new ${table.tableAlias}() : bean ;
		return ${table.tableAlias?uncap_first}Mapper.getPage(page,bean);
	}
}